package com.tbit.uqbike.object.view.sugar;

/**
 * @author MyWin E-mail:335918956@qq.com
 * @version 1.0
 * @createTime 2020-01-06 19:52
 */
public class AsteriskUtils {

    public static String handle(String str, Integer start, Integer len) {
        return handle(str, start, len, '*');
    }

    public static String handle(String str, Integer start, Integer len, char ch) {
        if (str == null) {
            return str;
        }
        char[] cs = str.toCharArray();
        for (int i = 0; i < len; i++) {
            int index = start + i;
            if (index < cs.length) {
                cs[index] = ch;
            } else {
                break;
            }
        }
        return new String(cs);
    }
}
